﻿using J.Model;
using J.ProductGet.Application.Command.ReleaseAppointmentCommand;
using MediatR;
using SqlSugar;

namespace J.ProductGet.Application.CommandHandler.ReleaseAppointmentCommandHandler
{
    public class ReleaseAppointmentGetCommandHandler : IRequestHandler<ReleaseAppointmentGetCommand, List<ReleaseAppointment>>
    {
        private readonly ISqlSugarClient _sqlSugarClient;
        public ReleaseAppointmentGetCommandHandler(ISqlSugarClient sqlSugarClient)
        {
            _sqlSugarClient = sqlSugarClient;
        }
        public async Task<List<ReleaseAppointment>> Handle(ReleaseAppointmentGetCommand request, CancellationToken cancellationToken)
        {
            return await _sqlSugarClient.Queryable<ReleaseAppointment>().ToListAsync();
        }
    }
}
